<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="reqXML()">U8-请求</button>
</body>
</html>

<script>

  function reqXML(){
    var xml = `<?xml version="1.0" encoding="utf-8"?>
    <ufinterface roottag="department" billtype="" docid="989898989898" receiver="u8" sender="pgs26698" proc="Query" codeexchanged="n" exportneedexch="n" display="部门档案" family="基础档案" version="2.0">
        <department name="部门档案" importfile="" exportfile="" code="001">
          <field display="部门编码" name="cDepCode" operation="=" value="2" logic="" />
        </department>
    </ufinterface>`;

    fetch('http://192.168.1.139/u8eai/import.asp', {
      method: 'POST', // or 'PUT'
      headers: {
        'Content-Type': 'application/json',
        'Access-Control-Allow-Origin':'*'
      },
      body: xml,
    })
    .then(response => response.text())
    .then(data => {
      console.log('Success:', data);
    })
    .catch((error) => {
      console.error('Error:', error);
    });
}
</script>